#! /bin/sh
# display velocity scans and "picks"

# Look at velocity scans -- in reality would make picks interactively
nv=120
dv=75.0
fv=4000.0
fold=12  # only have 12 shots, otherwise would be 64/2=32 for dsx=dgx
nout=501 # ns
dxout=0.004

for cdp in 1500 2000 2500 3000
do
	suwind <modeldata key=cdp min=$cdp max=$cdp count=$fold |
	suvelan nv=$nv dv=$dv fv=$fv |
	supsimage bclip=0.5 wclip=0.0 f2=$fv d2=$dv \
		label1="Time (sec)" label2="Velocity (ft/sec)" \
		title="Velocity Scan for CMP $cdp" \
		grid1=solid grid2=solid cmap=default >vscan.$cdp.eps
	sed <par.$cdp '
		s/tnmo/xin/
		s/vnmo/yin/
	' >unisam.p
	unisam nout=$nout fxout=0.0 dxout=$dxout \
		par=unisam.p method=linear |
	psgraph n=$nout nplot=1 d1=$dxout f1=0.0 \
		label1="Time (sec)" label2="Velocity (ft/sec)" \
		title="Stacking Velocity Function: CMP $cdp" \
		grid1=solid grid2=solid \
		linecolor=red style=seismic >vpick.$cdp.eps
done


# Create parameter file from "picks"
echo -n "cdp=" >stkvel.p
for cdp in 1500 2000 2500
do
	echo -n "$cdp," >>stkvel.p
done
echo 3000 >>stkvel.p

for cdp in 1500 2000 2500 3000
do
	cat <par.$cdp >>stkvel.p
done

echo 
echo "Output are PostScript files:  vscan.cdp.eps   vpick.cdp.eps"
echo "For cdp=1500,2000,2500,3000, (i.e. vscan.1500.eps, etc.)"
echo 
echo "You may view these with your PostScript Previewer"

exit
